﻿using Microsoft.WowAddonStudio.FrameXml.Serialization;
using Microsoft.WowAddonStudio.FrameXml.Serialization.LayoutFrames;

namespace Microsoft.WowAddonStudio.FrameXml.Components.Support
{
    public static class FrameExtensions
    {
		/// <summary>
		/// Gets the frame strata.
		/// </summary>
		/// <param name="frame">The frame.</param>
		/// <returns></returns>
        public static FrameStrata GetFrameStrata(this Frame frame)
        {
            if (frame == null)
                return FrameStrata.Medium;

            return frame.FrameStrata == FrameStrata.Parent ? GetFrameStrata(frame.ParentFrame as Frame) : frame.FrameStrata;
        }
    }
}
